//
//  CASViewController.m
//  CAS
//
//  Created by Lion User on 18/07/2012.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "CASViewController.h"

@interface CASViewController ()

@end

@implementation CASViewController
@synthesize webView;

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    NSString *serverAddress = @"https://cas.sfu.ca/cgi-bin/WebObjects/cas.woa/wa/login";
//    NSString *service=@"?service=serviceValidate";
   NSString *service=@"/app=SFU+Connect&allow=sfu,zimbra?service=https%3A%2F%2Fconnect.sfu.ca%2Fzimbra%2Fpublic%2Fpreauth.jsp";
    NSString *requestURL=[serverAddress stringByAppendingString:service];
    //Create a URL object.
    NSURL *url = [NSURL URLWithString:requestURL];
    //URL Requst Object
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
//    NSHTTPURLResponse *response;
//    NSError *error;
//    NSData *responseData = [NSURLConnection sendSynchronousRequest:requestObj
//                                                 returningResponse:&response 
//                                                             error:&error];
//    NSLog(responseData);
    //Load the request in the UIWebView.
//    [webView loadRequest:requestObj];
   [webView loadRequest:requestObj];
    [super viewDidLoad];
}

- (void)viewDidUnload
{
    [self setWebView:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

@end
